//
//  CYZiXunXiangGuanGuangGaoTableViewCell.m
//  cyydt
//
//  Created by chu on 2019/1/23.
//  Copyright © 2019 chu. All rights reserved.
//

#import "CYZiXunXiangGuanGuangGaoTableViewCell.h"

@implementation CYZiXunXiangGuanGuangGaoTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.zixunBtn.layer.cornerRadius =  5;
    self.zixunBtn.layer.borderColor = RGBOF(0xFF9982).CGColor;
    self.zixunBtn.layer.borderWidth = 1;
    self.zixunBtn.layer.masksToBounds = YES;
    
}

- (void)setModel:(CYProjectModel *)model{
    _model = model;
    [self.headImageView sd_setImageWithURL:[NSURL URLWithString:model.logo_item_sg] placeholderImage:[UIImage imageWithColor:[UIColor lightGrayColor] Size:self.headImageView.frame.size]];
    self.titleLabel.text = model.title;
    self.companyLabel.text = model.company_name;
    if ([model.funds isEqualToString:@"0"]) {
        self.feiyongLabel.text = @"全部";
    }else if ([model.funds isEqualToString:@"10"]){
        self.feiyongLabel.text = @"3万以下";
    }else if ([model.funds isEqualToString:@"15"]){
        self.feiyongLabel.text = @"3-8万";
    }else if ([model.funds isEqualToString:@"5"]){
        self.feiyongLabel.text = @"5-10万";
    }else if ([model.funds isEqualToString:@"6"]){
        self.feiyongLabel.text = @"10-20万";
    }else if ([model.funds isEqualToString:@"11"]){
        self.feiyongLabel.text = @"20万以上";
    }else{
        self.feiyongLabel.text = @"";
    }
    self.haopingLabel.text = [NSString stringWithFormat:@"好评%@%%",model.ratio_sg];    
}

- (IBAction)zixunAction:(UIButton *)sender {
    CYChatViewController *chat = [[CYChatViewController alloc] init];
    chat.url = [NSString stringWithFormat:@"%@?device=ios",self.model.wsurl];
    [[AppDelegate sharedAppDelegate] pushViewController:chat];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
